<?php

	function _order_resource_index($page, $params) {
		global $user;
		
		$orders = array();
		
		$res = db_query("SELECT * FROM {order}");
		
		foreach ($res as $order) {
			$orders[] = $order;
		}
		
		return $orders;
	}
	
	function _order_resource_retrieve($id) {
		return order_resource_get_order($id);
	}
	
	function _order_resource_accept($id) {
		$order = order_resource_get_order($id);
		$order->status = 1;
		order_resource_write_order($order);
	}
	
	function _order_resource_reject($id) {
		$order = order_resource_get_order($id);
		$order->status = 2;
		order_resource_write_order($order);
	}
	
	function _order_resource_ready($id) {
		$order = order_resource_get_order($id);
		$order->status = 3;
		order_resource_write_order($order);
	}

?>